
import 'package:flutterapp/home/entity/article_data_bean.dart';

class ItemListEntity {
    ItemListData? data;
    int? errorCode;
    String? errorMsg;

    ItemListEntity({this.data, this.errorCode, this.errorMsg});

    ItemListEntity.fromJson(Map<String, dynamic> json) {
        if(json["data"] is Map)
            this.data = json["data"] == null ? null : ItemListData.fromJson(json["data"]);
        if(json["errorCode"] is int)
            this.errorCode = json["errorCode"];
        if(json["errorMsg"] is String)
            this.errorMsg = json["errorMsg"];
    }

    Map<String, dynamic> toJson() {
        final Map<String, dynamic> data = new Map<String, dynamic>();
        if(this.data != null)
            data["data"] = this.data?.toJson();
        data["errorCode"] = this.errorCode;
        data["errorMsg"] = this.errorMsg;
        return data;
    }
}

class ItemListData {
    int? curPage;
    List<ArticleDataBean>? datas;
    int? offset;
    bool? over;
    int? pageCount;
    int? size;
    int? total;

    ItemListData({this.curPage, this.datas, this.offset, this.over, this.pageCount, this.size, this.total});

    ItemListData.fromJson(Map<String, dynamic> json) {
        if(json["curPage"] is int)
            this.curPage = json["curPage"];
        if(json["datas"] is List)
            this.datas = json["datas"]==null ? null : (json["datas"] as List).map((e)=>ArticleDataBean.fromJson(e)).toList();
        if(json["offset"] is int)
            this.offset = json["offset"];
        if(json["over"] is bool)
            this.over = json["over"];
        if(json["pageCount"] is int)
            this.pageCount = json["pageCount"];
        if(json["size"] is int)
            this.size = json["size"];
        if(json["total"] is int)
            this.total = json["total"];
    }

    Map<String, dynamic> toJson() {
        final Map<String, dynamic> data = new Map<String, dynamic>();
        data["curPage"] = this.curPage;
        if(this.datas != null)
            data["datas"] = this.datas?.map((e)=>e.toJson()).toList();
        data["offset"] = this.offset;
        data["over"] = this.over;
        data["pageCount"] = this.pageCount;
        data["size"] = this.size;
        data["total"] = this.total;
        return data;
    }
}